#ifndef _SPEED_STATISTICS_B55E3C04_4303_43D6_A47E_920A32552B12_
#define _SPEED_STATISTICS_B55E3C04_4303_43D6_A47E_920A32552B12_
#pragma once
#include "base/timer.h"
#include "base/threading/non_thread_safe.h"

namespace dl {

class SpeedStatistics : public base::NonThreadSafe {
public:
  SpeedStatistics();
  ~SpeedStatistics();
  void Start(base::Closure notify);
  void Stop();
  void Record(int64 bytes);
  int64 CurrentSpeed() const;
private:
  base::TimeTicks start_tick_;
  int64 total_bytes_;
  base::Timer timer_;
};

}

#endif //_SPEED_STATISTICS_B55E3C04_4303_43D6_A47E_920A32552B12_